<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>

<div id="app">
    <button @click="color='red'">红</button>
    <button @click="color='blue'">蓝</button>
    <div id="box" v-bind:class="color">
        点击按钮，背景会切换颜色哦
    </div>
</div>
<script src="./node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            color: "red", // 代表当前的class样式，目前是红
        }
    })
</script>

</body>
</html>